﻿<%@ Page Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="Statistics.aspx.cs"
    Inherits="smallDeimos.Statistics" Title="Small Deimos - statistics" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .newStyle1
        {
            border-spacing: 2px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table>
        <tr>
            <td>
                <asp:DataList ID="DataList1" runat="server" DataSourceID="ObjectDataSource1">
                    <ItemTemplate>
                        <table>
                            <tr>
                                <td>
                                    <tr>
                                        <td>
                                            Avarage Attack:
                                        </td>
                                        <td>
                                            <asp:Label ID="Avarage_AttackLabel" runat="server" Text='<%# Eval("[Avarage Attack]") %>' />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Avarage Defense:
                                        </td>
                                        <td>
                                            <asp:Label ID="Avarage_DefenseLabel" runat="server" Text='<%# Eval("[Avarage Defense]") %>' />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Avarage Speed:
                                        </td>
                                        <td>
                                            <asp:Label ID="Avarage_SpeedLabel" runat="server" Text='<%# Eval("[Avarage Speed]") %>' />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Avarage Culture:
                                        </td>
                                        <td>
                                            <asp:Label ID="Avarage_CultureLabel" runat="server" Text='<%# Eval("[Avarage Culture]") %>' />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Avarage Production:
                                        </td>
                                        <td>
                                            <asp:Label ID="Avarage_ProductionLabel" runat="server" Text='<%# Eval("[Avarage Production]") %>' />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Avarage Science:
                                        </td>
                                        <td>
                                            <asp:Label ID="Avarage_ScienceLabel" runat="server" Text='<%# Eval("[Avarage Science]") %>' />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Avarage Growth:
                                        </td>
                                        <td>
                                            <asp:Label ID="Avarage_GrowthLabel" runat="server" Text='<%# Eval("[Avarage Growth]") %>' />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Avarage Biology:
                                        </td>
                                        <td>
                                            <asp:Label ID="Avarage_BiologyLabel" runat="server" Text='<%# Eval("[Avarage Biology]") %>' />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Avarage Economy:
                                        </td>
                                        <td>
                                            <asp:Label ID="Avarage_EconomyLabel" runat="server" Text='<%# Eval("[Avarage Economy]") %>' />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Avarage Energy:
                                        </td>
                                        <td>
                                            <asp:Label ID="Avarage_EnergyLabel" runat="server" Text='<%# Eval("[Avarage Energy]") %>' />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Avarage Math:
                                        </td>
                                        <td>
                                            <asp:Label ID="Avarage_MathLabel" runat="server" Text='<%# Eval("[Avarage Math]") %>' />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Avarage Physics:
                                        </td>
                                        <td>
                                            <asp:Label ID="Avarage_PhysicsLabel" runat="server" Text='<%# Eval("[Avarage Physics]") %>' />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Avarage Social:
                                        </td>
                                        <td>
                                            <asp:Label ID="Avarage_SocialLabel" runat="server" Text='<%# Eval("[Avarage Social]") %>' />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Avarage Culture:
                                        </td>
                                        <td>
                                            <asp:Label ID="Avarage_Culture1Label" runat="server" Text='<%# Eval("[Avarage Culture1]") %>' />
                                        </td>
                                    </tr>
                        </table>
                        <br />
                        <br />
                    </ItemTemplate>
                </asp:DataList>
            </td>
            <td>
                <asp:DataList ID="DataList2" runat="server" DataSourceID="SqlDataSource2">
                    <ItemTemplate>
                        Number of players:
                        <asp:Label ID="Number_of_playersLabel" runat="server" 
                            Text='<%# Eval("[Number of players]") %>' />
                        <br />
                        <br />
                    </ItemTemplate>
                </asp:DataList>
            
            </td>
        </tr>
    </table>
    <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
        SelectMethod="NumberOfActivePlayers" TypeName="SD.Database.DataAccess"></asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        SelectMethod="GetStats" TypeName="SD.Database.DataAccess">
    </asp:ObjectDataSource>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:smallDeimosConnectionString %>"
        SelectCommand="SELECT AVG(Attack) AS [Avarage Attack], AVG(Defense) AS [Avarage Defense], AVG(Speed) AS [Avarage Speed], AVG(Culture) AS [Avarage Culture], AVG(Production) AS [Avarage Production], AVG(Science) AS [Avarage Science], AVG(Growth) AS [Avarage Growth], AVG(Biology) AS [Avarage Biology], AVG(Economy) AS [Avarage Economy], AVG(Energy) AS [Avarage Energy], AVG(Math) AS [Avarage Math], AVG(Physics) AS [Avarage Physics], AVG(Social) AS [Avarage Social], AVG(CurrentCulture) AS [Avarage Culture] FROM Players">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:smallDeimosConnectionString %>" 
        SelectCommand="SELECT COUNT(PlayerId) AS [Number of players] FROM Players WHERE (PlayerId &gt; 1) AND ((SELECT COUNT(OwnerID) AS Expr1 FROM Planets WHERE (OwnerID = Players.PlayerId)) &gt; 0)"></asp:SqlDataSource>
</asp:Content>
